﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TR.AppService.Dto;
using TR.AppService.Dto.WHOMDto;
using TR.Domain.Entity;
using TR.Domain.Entity.WH_return_;
using TR.Domain.Entity.WHOB;
using TR.Domain.Repository.WHOM_return_suppy;
using TR.Domain.Repository.WHOM_SelectRepository;

namespace TR.AppService.AppService.WHOM_suppy
{

    public class wh_return_suppy_hx : wh_return_suppy_h
    {
        private readonly wh_return_suppy_Dom Wsr;
        private readonly IMapper mapper;
        public wh_return_suppy_hx(wh_return_suppy_Dom Wsr, IMapper mapper)
        {
            this.Wsr = Wsr;
            this.mapper = mapper;
        }

        public async Task<bool> addwhom_d(wh_return_suppy_d wh_Return_Suppy_D)
        {
            return  await Wsr.addwhom_d(wh_Return_Suppy_D);
        }

        public async Task<bool> addwhom_h(Domain.Entity.WH_return_.wh_return_suppy_h wh_Return_Suppy_H)
        {
            return  await Wsr.addwhom_h(wh_Return_Suppy_H);
        }

        public async Task<List<wh_orderbuy_d>> Regret(string buy_code)
        {
            List<wh_orderbuy_d> wh_Orderbuy_Ds =await Wsr.Regret(buy_code);
            return wh_Orderbuy_Ds;
        }

        public async Task<DtoFenYe<TR.Domain.Entity.WH_return_.wh_return_suppy_h>> WHOB_FenYeSelect(int mys, int dqy, string? qsj, string? hsj)
        {
            var listFenYe = await Wsr.WHRCZ(mys, dqy, qsj, hsj);
            var zts = await  Wsr.WHRShu();
            var res = new DtoFenYe<TR.Domain.Entity.WH_return_.wh_return_suppy_h>()
            {
                mys = mys,
                dqy = dqy,
                list = listFenYe,
                zts = zts
            };
            return res;
        }

       
    }
}
